function [obs_obj,obs_cen,obs_rad]=obs_gen()
    % 初始化参数  
    numPoints = 8;  
    xRange = [2, 7];  
    yRange = [2, 4];  
    minRadius = 0.2;  
    maxRadius = 0.1;  
    maxAttempts = 0.1;  
    % 存储圆心和半径  
    centers = zeros(2, numPoints);  
    radii = zeros(1, numPoints);  
     % 生成圆形  
    for i = 1:numPoints  
        attempt = 0;  
        while attempt < maxAttempts  
            % 生成随机圆心  
            cx = xRange(1) + (xRange(2) - xRange(1)) * rand();  
            cy = yRange(1) + (yRange(2) - yRange(1)) * rand();  
              
            % 生成随机半径  
            r = minRadius + (maxRadius - minRadius) * rand();  
              
            % 检查是否与已有圆形相交  
            overlap = false;  
            for j = 1:i-1  
                dx = cx - centers(1, j);  
                dy = cy - centers(2, j);  
                distance = sqrt(dx^2 + dy^2);  
                if distance < r + radii(j)  
                    overlap = true;  
                    break;  
                end  
            end  
              
            % 如果没有相交，则接受这个圆形  
            if ~overlap  
                centers(1, i) = cx;  
                centers(2, i) = cy;  
                radii(i) = r;  
                break;  
            end  
              
            % 增加尝试次数  
            attempt = attempt + 1;  
        end  
          
        % 如果尝试次数过多，则可能无法生成所有不相交的圆形  
        if attempt == maxAttempts  
            warning('无法生成所有不相交的圆形，请尝试调整参数。');  
            break;  
        end  
    end
    obs_cen=centers';
    obs_rad=radii';
    angle_range=0:pi/180:2*pi;
    number_ang=size(angle_range);
    number=size(centers);
    obX=[];
    obY=[];
    for i=1:number(2)
        for j=1:number_ang(2)
            cen_i=centers(:,i);
            radi_i=radii(i);
            angi=angle_range(j);
            Xi=cen_i(1)+radi_i*cos(angi);
            Yi=cen_i(2)+radi_i*sin(angi);
            obX=[obX;Xi];
            obY=[obY;Yi];
        end
    end
    obs_obj=[obX,obY];
    % 绘制圆形  
%     figure;  
%     hold on;  
%     for i = 1:size(centers, 2)  
%         rectangle('Position', [centers(1, i) - radii(i), centers(2, i) - radii(i), 2 * radii(i), 2 * radii(i)], 'Curvature', [1, 1], 'FaceColor', 'r');  
%     end  
%     hold off;  
%     axis equal;  
%     grid on;  
% end
end